package com.misoo.ex10;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.RadioButton;

public class Ex10Activity extends Activity implements OnClickListener{
    /** Called when the activity is first created. */
    private final int WC = ViewGroup.LayoutParams.WRAP_CONTENT;
    DrawView dv;
	@Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        LinearLayout layout = new LinearLayout(this);
        layout.setOrientation(LinearLayout.HORIZONTAL);
        LinearLayout.LayoutParams param =
        		new LinearLayout.LayoutParams(150,300);
        param.leftMargin = 1;
        dv = new DrawView(this);
        layout.addView(dv,param);
        
        RadioButton ra;
        ra = new RadioButton(this);
        param = new LinearLayout.LayoutParams(WC,WC);
        param.topMargin = 40;
        layout.addView(ra,param);
        
        ra.setOnClickListener(this);
        setContentView(layout);
    }
	public void onClick(View arg0){
		dv.invalidate();
	}
}